
use pamd;

----------------------------------- User -------------------------------------------------
INSERT INTO [dbo].[UserDetail]([FirstName],[LastName],[Email],[Password],[Country],[ContactNumber],[Mobile],[AddressID],[DateOfBirth],[Occupation],[AccountEnabled])   
VALUES('Dipak','Bava','dvbava@yahoo.com','dipak','United Kingdom','1234567890','9876543210',1,'06/01/1978','Banking and Investment',1);

INSERT INTO [dbo].[UserDetail]([FirstName],[LastName],[Email],[Password],[Country],[ContactNumber],[Mobile],[AddressID],[DateOfBirth],[Occupation],[AccountEnabled])   
VALUES('Sangita','Goswami','sdbava@yahoo.com','sangita','United Kingdom','1234567890','9876543210',1,'01/01/1982','Banking and Investment',1);


INSERT INTO [dbo].[Address]([Line1],[Line2],[Line3],[City],[County],[PostCode],[Country],[AddressType],[UserID])
     VALUES('271','Ealing Road','Alperton','Wembley','MiddleSex','HA01EU','United Kingdom','Permanent',1);
INSERT INTO [dbo].[Address]([Line1],[Line2],[Line3],[City],[County],[PostCode],[Country],[AddressType],[UserID])
     VALUES('271','Ealing Road',Null,'Wembley','MiddleSex','HA01EU','United Kingdom','Permanent',2);

-------------------------------------- Listing ---------------------------------------------

BEGIN

DECLARE @id INT;
SET @id =1;

WHILE (@id < 50)
		BEGIN
			INSERT INTO [dbo].[Address]([Line1],[Line2],[Line3],[City],[County],[PostCode],[Country],[AddressType],[UserID])
				 VALUES('271','Kenton Road','Kingsbury','Harrow','MiddleSex','HA93RD','United Kingdom','Listing',1);
			     
			INSERT INTO [dbo].[ListingFeature]([Available247],[KeyReq],[CCTV],[Gated],[LocalTrain],[Lighted],[LocalBus],[Sheltered],[SecurityGuard])     
			VALUES(1,0,1,1,1,1,0,0,0);

			INSERT INTO [dbo].[ListingPrice]([ListingID],[Price],[PriceDuration],[Vehicle]		,[Bid])
				 VALUES							(@id			,25		,'Week'			,'Large Vehicle',10);

			INSERT INTO [dbo].[ListingPrice]([ListingID],[Price],[PriceDuration],[Vehicle]	,[Bid])
				 VALUES							(@id			,100		,'Year'		,'Motorcycle'	,20);

			INSERT INTO [dbo].[ListingPrice]([ListingID],[Price],[PriceDuration],[Vehicle]	,[Bid])
				 VALUES							(@id			,10		,'Week'			,'Car'		,2);

			INSERT INTO [dbo].[ListingPrice]([ListingID],[Price],[PriceDuration],[Vehicle]	,[Bid])
				 VALUES							(@id			,50		,'Month'			,'Car'		,10);

			INSERT INTO [dbo].[ListingPrice]([ListingID],[Price],[PriceDuration],[Vehicle]	,[Bid])
				 VALUES							(@id			,2		,'Hour'		,'Motorcycle'	,1);

			INSERT INTO [dbo].[ListingPhoto]([FileName],[ListingID],[IsPrimary])
				 VALUES('unknown.jpg',@id,1);

			INSERT INTO [dbo].[Listing]           ([UserID]           ,[Title]           ,[NumberOfSpace]           ,[SpaceCategory]           ,[SpaceRestriction]           ,[IsPrivate]           ,[Daily]           ,[Weekly]           ,[Monthly]           ,[Annual]           ,[OnEventDays]           ,[Deposit]           ,[MinRentalPeriod]           ,[MinRentalPeriodUnit]           ,[FeatureID]           ,[AddressID]           ,[ContactNumber]           ,[SpaceDescription]           ,[IsActive])
				 VALUES           (1           ,'Spacious Parking on Wembley Road'           ,3           ,'Car Park'           ,'Small cars only'           ,1           ,1           ,1           ,1           ,0           ,1           ,20           ,1           ,'Day'           
				 ,@id           ,@id + 2           ,'0123678321'           ,'5-10 minutes walk to stadium on the Wembley Stadium Estate ideal location for a quick getaway to the A406 and all major routes, Atlas road wembley, HA9 0JH. Call now as spaces fill quickly due to'           ,1);

			set @id = @id + 1;
		END;
END;
GO